package com.financing.wap.dao.impl;


import java.sql.SQLException;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.financing.wap.common.SqlName;
import com.financing.wap.dao.IDstIntegralRuleDao;
import com.financing.wap.dto.DstIntegralRuleDTO;
/**
 * dst_integral_rule  
 * 积分规则表 数据访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("dstIntegralRuleDao")
public class DstIntegralRuleDaoImpl extends BaseDaoImpl<DstIntegralRuleDTO, java.lang.Integer> implements IDstIntegralRuleDao {


	@Override
	public int insert(DstIntegralRuleDTO dstIntegralRule) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.insert(SqlName.DstIntegralRuleSql.insert, dstIntegralRule);
	}

	@Override
	public void update(DstIntegralRuleDTO dstIntegralRule) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.DstIntegralRuleSql.update, dstIntegralRule);
	}

	@Override
	public void updateForce(DstIntegralRuleDTO dstIntegralRule) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.DstIntegralRuleSql.updateForce, dstIntegralRule);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		this.sqlMapClientTemplate.delete(SqlName.DstIntegralRuleSql.delete,id);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<DstIntegralRuleDTO> queryList(DstIntegralRuleDTO dstIntegralRule) throws SQLException {
		return this.sqlMapClientTemplate.queryForList(SqlName.DstIntegralRuleSql.queryList, dstIntegralRule);
	}

	@Override
	public int queryListCount(DstIntegralRuleDTO dstIntegralRule) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.queryForObject(SqlName.DstIntegralRuleSql.queryListCount, dstIntegralRule);
	}

	@Override
	public DstIntegralRuleDTO loadById(Integer id) throws SQLException {
		return  (DstIntegralRuleDTO)this.getSqlMapClientTemplate().queryForObject(SqlName.DstIntegralRuleSql.loadById,id);
	}

	@Override
	public Class<DstIntegralRuleDTO> getEntityClass() {
		return DstIntegralRuleDTO.class;
	}
 	
}
